<template>
    <div class="recommend-container">
        <!-- 导航标签 -->
        <div class="nav-tabs-wrapper">
            <div class="nav-tabs">
                <router-link v-for="(tab, index) in tabs" :key="index" :to="tab.path" class="tab-link"
                    active-class="active" exact-active-class="exact-active">
                    <div class="tab-content">
                        <i :class="tab.icon"></i>
                        <span class="tab-title">{{ tab.title }}</span>
                    </div>
                    <div class="tab-indicator"></div>
                </router-link>
            </div>


            <!-- 动态内容区域 -->
            <div class="recommend-content">
                <router-view v-slot="{ Component }">
                    <transition name="fade" mode="out-in">
                        <component :is="Component" />
                    </transition>
                </router-view>
            </div>

            
        </div>
    </div>
</template>

<script>
export default {
    name: 'RecommendPage',
    data() {
        return {
            tabs: [
                { title: '热门目的地', path: '/recommend/popularDestinations', icon: 'fas fa-fire' },
                { title: '特色旅游', path: '/recommend/featuredTours', icon: 'fas fa-calendar-alt' },
                { title: '旅行者评价', path: '/recommend/travelerReviews', icon: 'fas fa-tags' },
                { title: '特价优惠', path: '/recommend/newsletterSubscription', icon: 'fas fa-percentage' },
            ],
            seasons: ['春季', '夏季', '秋季', '冬季'],
            activeSeason: '春季',
            features: [
                {
                    id: 1,
                    title: '极光之旅',
                    description: '在北极圈追逐神秘极光',
                    image: 'https://images.unsplash.com/photo-1512273222628-4d88e7537a72',
                    link: '/destinations/northern-lights'
                },
                {
                    id: 2,
                    title: '美食探索',
                    description: '品尝世界各地的地道美食',
                    image: 'https://images.unsplash.com/photo-1414235077428-338989a2e8c0',
                    link: '/themes/food-tour'
                },
                {
                    id: 3,
                    title: '冒险体验',
                    description: '刺激肾上腺素的活动',
                    image: 'https://images.unsplash.com/photo-1530521954074-e64f6810b32d',
                    link: '/activities/adventure'
                }
            ]
        }
    },
    methods: {
        filterBySeason(season) {
            this.activeSeason = season
            // 这里可以添加筛选逻辑
        }
    }
}
</script>

<style scoped>
/* 基础样式 */
:root {
    --primary-color: #4a6bff;
    --secondary-color: #ff7e5f;
    --dark-color: #2d3436;
    --light-color: #f5f6fa;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

.recommend-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
}

/* 导航标签样式 */
.nav-tabs-wrapper {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.tab-link {
    padding: 15px 25px;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tab-content {
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.tab-link i {
    font-size: 18px;
    margin-right: 8px;
}

.tab-title {
    font-size: 15px;
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
    transition: var(--transition);
}

/* 激活状态样式 */
.tab-link.active {
    color: var(--primary-color);
}

.tab-link.active .tab-indicator {
    width: 60%;
}

.tab-link.exact-active {
    color: var(--primary-color);
}

.tab-link.exact-active .tab-indicator {
    width: 100%;
}

/* 悬停效果 */
.tab-link:hover:not(.active):not(.exact-active) {
    color: var(--primary-color);
}

.tab-link:hover:not(.active):not(.exact-active) .tab-indicator {
    width: 30%;
    background-color: rgba(74, 107, 255, 0.3);
}

/* 英雄区域 */
.hero-section {
    height: 60vh;
    min-height: 500px;
    background:
        linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
        url('https://images.unsplash.com/photo-1499678329028-101435549a4e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.season-tags {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.season-tags span {
    padding: 8px 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.season-tags span:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.season-tags span.active {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* 内容区域 */
.recommend-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    min-height: 500px;
}

/* 路由过渡动画 */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* 特色推荐区域 */
.featured-section {
    padding: 60px 20px;
    background-color: var(--white);
}

.featured-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--dark-color);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    height: 350px;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
}

.feature-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white);
    transform: translateY(100px);
    transition: var(--transition);
}

.feature-card:hover .feature-overlay {
    transform: translateY(0);
}

.feature-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.feature-overlay p {
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.feature-card:hover .feature-overlay p {
    opacity: 1;
}

.explore-btn {
    display: inline-block;
    padding: 8px 20px;
    background-color: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
}

.explore-btn:hover {
    background-color: #e66a4a;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section {
        height: 50vh;
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .nav-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
    }

    .tab-link {
        padding: 12px 20px;
        flex-shrink: 0;
    }

    .tab-title {
        font-size: 14px;
    }

    .tab-link i {
        font-size: 16px;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .recommend-content {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 70vh;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .season-tags {
        flex-wrap: wrap;
    }

    .season-tags span {
        padding: 6px 15px;
        font-size: 14px;
    }

    .tab-link {
        padding: 10px 15px;
    }

    .tab-content {
        flex-direction: column;
    }

    .tab-link i {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .tab-title {
        font-size: 12px;
    }

    .feature-card {
        height: 250px;
    }

    .feature-overlay {
        padding: 20px;
    }
}
</style>